const request = require('request');
class apiBase {
	constructor(){
	}
	getVerifyCode() {
		return new Promise((resolve, reject) => {
			request({
				url: 'http://www.zhipaiwu.com/index.php/Index/verify.html?tm=' + Math.random(),
				method: 'get',
				encoding: null,
				headers: {
					'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36',
					Accept: 'image/webp,image/apng,image/*,*/*;q=0.8',
					Host: 'www.zhipaiwu.com',
					Referer: 'http://www.zhipaiwu.com/index.php/Semblance_check/list1/.html',
				},
				jar: true,
			},function (error, response, body) {
				if (!error && response.statusCode === 200) {
					resolve(body);
				}else{
					reject({error:response.statusCode});
				}
			})
		});
	}
}
module.exports = apiBase;